// modules/introduce/pages/project/project.js
import {
  getProject,
  getProjectDetail
} from '@/api/introduce'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    project: [],
    projectDetail: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad(options) {
    const {
      data
    } = await getProject()
    // console.log(data)
    this.setData({
      project: data
    })

    // 请求每个推文具体信息
    this.data.project.map(async item => {
      const res = await getProjectDetail(item.id)
      // console.log(res.data)
      this.setData({
        projectDetail: [...this.data.projectDetail, res.data]
      });
    });
 
  },



})